<?php

/**
 * goldenratio actions.
 *
 * @package    sf_sandbox
 * @subpackage goldenratio
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class goldenratioActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
  }

  public function executeSimpleSequence(sfWebRequest $request)
  {
    $this->startValue = $request->getParameter('startValue');

    $this->nrResults = $request->getParameter('nrResults');

    $this->phy = new Phy();

    $this->sequence = $this->phy->getSequenceFrom($this->startValue, $this->nrResults);
    
    $this->percentageSequence = $this->phy->getPercentageSequence($this->sequence);
  }

  public function executeColorSimpleSequence(sfWebRequest $request)
  {
    $this->color = new Color();

    $this->randomColorSequenceTest = $this->color->getPhyRGBSequence(array(rand(1, 255), rand(1, 255), rand(1, 255)));

    $this->blackSequenceTest = $this->color->getPhyRGBSequence(array(1, 1, 1));

    $this->redSequenceTest = $this->color->getPhyRGBSequence(array(255, 1, 1));

    $this->greenSequenceTest = $this->color->getPhyRGBSequence(array(1, 255, 1));

    $this->blueSequenceTest = $this->color->getPhyRGBSequence(array(1, 1, 255));
  }
}
